using System;
using GameKit.Core;
using GameKitUnity.Core;
using UnityEngine;

namespace OneGame.Gameplay
{
    public static class PlayerFactory
    {
        public static void Create(object target, Action<GameObject> callback)
        {
            AssetLoader.Instance.Load<GameObject>(target, "Player", prefab =>
            {
                var gameObject = UnityEngine.Object.Instantiate(prefab);
                var entity = gameObject.GetOrAddComponent<EntityBehaviour>();
                callback?.Invoke(gameObject);
            });
        }
    }
}